home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Aliases.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  6.5 KB  |  207 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Aliases.a
  3. ;
  4. ;    Contains:    Alias Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1989-1995, 1997-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN
  19. __ALIASES__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  25.     include 'AppleTalk.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.  
  31.  
  32. rAliasType                        EQU        'alis'                ; Aliases are stored as resources of this type 
  33.  
  34.                                                             ; define alias resolution action rules mask 
  35. kARMMountVol                    EQU        $00000001            ; mount the volume automatically 
  36. kARMNoUI                        EQU        $00000002            ; no user interface allowed during resolution 
  37. kARMMultVols                    EQU        $00000008            ; search on multiple volumes 
  38. kARMSearch                        EQU        $00000100            ; search quickly 
  39. kARMSearchMore                    EQU        $00000200            ; search further 
  40. kARMSearchRelFirst                EQU        $00000400            ; search target on a relative path first 
  41.  
  42.                                                             ; define alias record information types 
  43. asiZoneName                        EQU        -3                    ; get zone name 
  44. asiServerName                    EQU        -2                    ; get server name 
  45. asiVolumeName                    EQU        -1                    ; get volume name 
  46. asiAliasName                    EQU        0                    ; get aliased file/folder/volume name 
  47. asiParentName                    EQU        1                    ; get parent folder name 
  48. ;  ResolveAliasFileWithMountFlags options 
  49.  
  50. kResolveAliasFileNoUI            EQU        $00000001            ; no user interaction during resolution 
  51. ;  define the alias record that will be the blackbox for the caller 
  52. AliasRecord                RECORD 0
  53. userType                 ds.l    1                ; offset: $0 (0)        ;  appl stored type like creator type 
  54. aliasSize                 ds.w    1                ; offset: $4 (4)        ;  alias record size in bytes, for appl usage 
  55. sizeof                     EQU *                    ; size:   $6 (6)
  56.                         ENDR
  57. ; typedef struct AliasRecord *            AliasPtr
  58.  
  59. ; typedef AliasPtr *                    AliasHandle
  60.  
  61. ;  alias record information type 
  62. ; typedef short                         AliasInfoType
  63.  
  64. ;   create a new alias between fromFile-target and return alias record handle  
  65. ;
  66. ; pascal OSErr NewAlias(ConstFSSpecPtr fromFile, const FSSpec *target, AliasHandle *alias)
  67. ;
  68.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  69.         Macro
  70.         _NewAlias
  71.             moveq               #2,D0
  72.             dc.w                $A823
  73.         EndM
  74.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  75.         IMPORT_CFM_FUNCTION NewAlias
  76.     ENDIF
  77.  
  78. ;  create a minimal new alias for a target and return alias record handle 
  79. ;
  80. ; pascal OSErr NewAliasMinimal(const FSSpec *target, AliasHandle *alias)
  81. ;
  82.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  83.         Macro
  84.         _NewAliasMinimal
  85.             moveq               #8,D0
  86.             dc.w                $A823
  87.         EndM
  88.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  89.         IMPORT_CFM_FUNCTION NewAliasMinimal
  90.     ENDIF
  91.  
  92. ;  create a minimal new alias from a target fullpath (optional zone and server name) and return alias record handle  
  93. ;
  94. ; pascal OSErr NewAliasMinimalFromFullPath(short fullPathLength, const void *fullPath, ConstStr32Param zoneName, ConstStr31Param serverName, AliasHandle *alias)
  95. ;
  96.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  97.         Macro
  98.         _NewAliasMinimalFromFullPath
  99.             moveq               #9,D0
  100.             dc.w                $A823
  101.         EndM
  102.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  103.         IMPORT_CFM_FUNCTION NewAliasMinimalFromFullPath
  104.     ENDIF
  105.  
  106. ;  given an alias handle and fromFile, resolve the alias, update the alias record and return aliased filename and wasChanged flag. 
  107. ;
  108. ; pascal OSErr ResolveAlias(ConstFSSpecPtr fromFile, AliasHandle alias, FSSpec *target, Boolean *wasChanged)
  109. ;
  110.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  111.         Macro
  112.         _ResolveAlias
  113.             moveq               #3,D0
  114.             dc.w                $A823
  115.         EndM
  116.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  117.         IMPORT_CFM_FUNCTION ResolveAlias
  118.     ENDIF
  119.  
  120. ;  given an alias handle and an index specifying requested alias information type, return the information from alias record as a string. 
  121. ;
  122. ; pascal OSErr GetAliasInfo(AliasHandle alias, AliasInfoType index, Str63 theString)
  123. ;
  124.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  125.         Macro
  126.         _GetAliasInfo
  127.             moveq               #7,D0
  128.             dc.w                $A823
  129.         EndM
  130.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  131.         IMPORT_CFM_FUNCTION GetAliasInfo
  132.     ENDIF
  133.  
  134.  
  135. ;  
  136. ;  Given a file spec, return target file spec if input file spec is an alias.
  137. ;  It resolves the entire alias chain or one step of the chain.  It returns
  138. ;  info about whether the target is a folder or file; and whether the input
  139. ;  file spec was an alias or not. 
  140. ;
  141.  
  142. ;
  143. ; pascal OSErr ResolveAliasFile(FSSpec *theSpec, Boolean resolveAliasChains, Boolean *targetIsFolder, Boolean *wasAliased)
  144. ;
  145.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  146.         Macro
  147.         _ResolveAliasFile
  148.             moveq               #12,D0
  149.             dc.w                $A823
  150.         EndM
  151.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  152.         IMPORT_CFM_FUNCTION ResolveAliasFile
  153.     ENDIF
  154.  
  155.  
  156. ;
  157. ; pascal OSErr FollowFinderAlias(ConstFSSpecPtr fromFile, AliasHandle alias, Boolean logon, FSSpec *target, Boolean *wasChanged)
  158. ;
  159.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  160.         Macro
  161.         _FollowFinderAlias
  162.             moveq               #15,D0
  163.             dc.w                $A823
  164.         EndM
  165.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  166.         IMPORT_CFM_FUNCTION FollowFinderAlias
  167.     ENDIF
  168.  
  169. ;  
  170. ;   Low Level Routines 
  171. ;
  172.  
  173. ;  given a fromFile-target pair and an alias handle, update the lias record pointed to by alias handle to represent target as the new alias. 
  174. ;
  175. ; pascal OSErr UpdateAlias(ConstFSSpecPtr fromFile, const FSSpec *target, AliasHandle alias, Boolean *wasChanged)
  176. ;
  177.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  178.         Macro
  179.         _UpdateAlias
  180.             moveq               #6,D0
  181.             dc.w                $A823
  182.         EndM
  183.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  184.         IMPORT_CFM_FUNCTION UpdateAlias
  185.     ENDIF
  186.  
  187.  
  188.  
  189. ;   Given an alias handle and fromFile, match the alias and return aliased filename(s) and needsUpdate flag 
  190. ;
  191. ; pascal OSErr MatchAlias(ConstFSSpecPtr fromFile, unsigned long rulesMask, AliasHandle alias, short *aliasCount, FSSpecArrayPtr aliasList, Boolean *needsUpdate, AliasFilterUPP aliasFilter, void *yourDataPtr)
  192. ;
  193.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  194.         Macro
  195.         _MatchAlias
  196.             moveq               #5,D0
  197.             dc.w                $A823
  198.         EndM
  199.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  200.         IMPORT_CFM_FUNCTION MatchAlias
  201.     ENDIF
  202.  
  203.  
  204.  
  205.     ENDIF ; __ALIASES__ 
  206.  
  207.